package com.hsgene.product.service.api;

import com.hsgene.common.util.result.ApiResult;
import com.hsgene.product.service.api.impl.AgencyServiceImpl;
import com.hsgene.supplier.domain.GeneticTestingAgency;
import com.hsgene.supplier.dto.GeneticTestingAgencyDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @Description: 机构（新表）
 * @ProjectName: hdas-geneshop
 * @Package: com.hsgene.web.console.service
 * @Author: FX
 * @CreateDate: 2018/10/17 14:40
 * @Version: 1.0
 * Copyright: Copyright (c) 2018
 */
@FeignClient(name = "ms-mod-supplier", path = "/v1.0/genetic/testing/agency", fallback = AgencyServiceImpl.class)
public interface AgencyService {

    /**
     * 添加检测机构
     *
     * @return
     * @author FX
     * @date 2018/10/17 11:07
     * @Param geneticTestingAgency
     */
    @PostMapping("agency")
    ApiResult saveAgency(@RequestBody GeneticTestingAgency geneticTestingAgency);

    /**
     * 修改
     *
     * @param geneticTestingAgency
     * @return
     * @author FX
     * @date 2018/10/17 11:58
     */
    @PutMapping
    ApiResult updateAgency(@RequestBody GeneticTestingAgency geneticTestingAgency);


    /**
     * 列表
     *
     * @param orderBy
     * @param isAsc
     * @param pageNo
     * @param pageSize
     * @param name
     * @param isAll
     * @return
     * @author FX
     * @date 2018/10/17 13:50
     */
    @GetMapping
    ApiResult getList(
            @RequestParam(name = "orderBy", required = false) String orderBy,
            @RequestParam(name = "isAsc", defaultValue = "false") Boolean isAsc,
            @RequestParam(name = "pageNo", defaultValue = "1") int pageNo,
            @RequestParam(name = "pageSize", defaultValue = "10") int pageSize
            , @RequestParam(name = "name", required = false) String name
            , @RequestParam(name = "isAll", required = false) Boolean isAll
    );

    /**
     * 详情
     *
     * @param id
     * @return
     * @author FX
     * @date 2018/10/17 11:58
     */
    @GetMapping("{id}")
    ApiResult<GeneticTestingAgencyDto> getAgencyById(@PathVariable("id") String id);

    /**
     * 删除
     *
     * @param id
     * @return
     * @author FX
     * @date 2018/10/17 14:31
     */
    @DeleteMapping("{id}")
    ApiResult deleteAgenecy(@PathVariable("id") String id);
}
